package com.spzx.product.api.factory;

import com.spzx.common.core.domain.R;
import com.spzx.product.api.domain.vo.SkuLockVo;
import com.spzx.product.api.service.RemoteSkuStocktService;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.List;

public class RemoteSkuStockFallbackFactory implements FallbackFactory<RemoteSkuStocktService> {
    @Override
    public RemoteSkuStocktService create(Throwable cause) {
        return new RemoteSkuStocktService() {
            @Override
            public R<String> checkAndLockStock(String tradeNo, List<SkuLockVo> skuLockVoList, String source) {
                return R.fail("远程调用失败" + cause.getMessage());
            }

        };
    }
}
